package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface OrderMapper {

    void save(Orders orders);

    Orders findOrderByOrderNum(String orderNum);

    void update(Orders orders);

    Orders orderById(Long id);

    /**
     *根据id查询订单
     * @param id
     * @return
     */
    Orders getById(Long id);

    Page<Orders> findByStatus(Integer status);

    Orders findOrderById(Long id);

    /**
     * 查询所有的超时订单
     * @param time
     * @return
     */
    List<Orders> findOvertimeOrders(LocalDateTime time);

    List<Orders> findByStatusAndTime(@RequestParam("status") Integer status,@RequestParam("status") LocalDateTime time);
}
